package com.service;

import java.util.List;

import com.dao.EmployeesDAO;
import com.domain.Employees;
import com.util.MD5Util;

public class LoginService {
	public boolean login(String username, String password) {
		EmployeesDAO dao = new EmployeesDAO();
		List<Employees> list = dao.getUserByName(username);
		for (Employees e : list) {
			if (e.getPassword().equals(MD5Util.md5(username + password))) {
				return true;
			}
		}
		return false;
	}
}
